package com.esri.core.internal.tasks.ags;

import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.UserCredentials;
import com.esri.core.portal.PortalInfo;

/* loaded from: classes.dex */
public class aa extends com.esri.core.internal.tasks.d<PortalInfo> {
    private static final long serialVersionUID = 1;

    public aa(al alVar, String str, UserCredentials userCredentials) {
        this(alVar, str, userCredentials, null);
    }

    public aa(al alVar, String str, UserCredentials userCredentials, TaskListener<PortalInfo> taskListener) {
        super(alVar, a(str, alVar.a.isPreVersion162()), userCredentials, taskListener);
    }

    private static final String a(String str, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        sb.append(z ? "/accounts/self" : "/portals/self");
        return sb.toString();
    }

    @Override // com.esri.core.internal.tasks.a
    /* renamed from: a */
    public PortalInfo execute() throws Exception {
        return PortalInfo.fromJson(com.esri.core.internal.io.handler.h.a(this.serviceURL, this.actionInput.generateRequestParams(), getServiceCredentials()), ((al) getActionInput()).a);
    }
}
